<template>
  <div class="no">
    <div>404(3秒后跳回主页)</div>
  </div>
</template>
<script>
import { reactive, toRefs } from "@vue/reactivity";
import { onBeforeMount, onBeforeUnmount } from "@vue/runtime-core";
export default {
  setup() {
    let time;
    const state = reactive({});
    onBeforeMount(() => {
      time = setTimeout(() => {
        window.location.href = "/home";
      }, 3000);
    });
    onBeforeUnmount(() => {
      clearTimeout(time);
    });
    return { ...toRefs(state) };
  },
};
</script>
<style lang="less" scoped>
.no {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: rgb(216, 96, 96);
  font-size: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
